package com.wenson.creational.factory;

/**
 * @author: luowangcheng
 * @data：2024/6/10 17:39
 * @description:
 */
public class Client {
    public static void main(String[] args) {
        int screenWidth = 100; // 假设屏幕宽度
        System.out.println("游戏开始");

        Factory factory = new TankFactory();
        for (int i = 0; i < 5; i++) {
            factory.create(screenWidth).show();
        }

        factory = new AirplaneFactory();
        for (int i = 0; i < 5; i++) {
            factory.create(screenWidth).show();
        }

        System.out.println("抵达关底");
        factory = new BossFactory();
        factory.create(screenWidth).show();


        /*SimpleFactory factory = new SimpleFactory(100);
        factory.create("Airplane").show();
        factory.create("Tank").show();*/

//        Random random = new Random();
//        int x = random.nextInt(screenWidth);
//        Enemy airplane = new Airplane(x, 0);
//        airplane.show();
//
//        x = random.nextInt(screenWidth);
//        Enemy tank = new Tank(x, 0);
//        tank.show();
    }
}
